import request from '@/utils/request'

// 查询关区代码列表
export function getCustomsList(params) {
  return request({
    url: '/system/customs/selectList',
    method: 'get',
    params
  })
}

// 校验身份证真实性
export function checkIdCardNo(params) {
  return request({
    url: '/bt/people/check/' + params,
    method: 'get',
  })
}

/***
 * 边民备案
 */
// 边民备案-列表
export function findBorderPeoplePage(params) {
  return request({
    url: '/bt/people/list',
    method: 'get',
    params
  })
}

// 边民备案-新增
export function saveBorderPeople(params) {
  return request({
    url: '/bt/people',
    method: 'post',
    data: params
  })
}

// 边民备案-修改
export function updateBorderPeople(params) {
  return request({
    url: '/bt/people',
    method: 'put',
    data: params
  })
}

// 边民备案-变更申报
export function updateBorderPeopleDecl(params) {
  return request({
    url: '/bt/people/modifyDecl',
    method: 'post',
    data: params
  })
}

// 边民备案-删除
export function DeleteBorderPeople(ids) {
  return request({
    url: `/bt/people/${ids}`,
    method: 'delete',
  })
}

// 边民备案-导出列表
export function exportBorderPeople(params) {
  return request({
    url: '/bt/people/export',
    method: 'get',
    params
  })
}

// 边民备案-详情
export function BorderPeopleDetail(id) {
  return request({
    url: `/bt/people/${id}`,
    method: 'get'
  })
}

// 边民备案-申报
export function BorderPeopleDecl(id) {
  return request({
    url: `/bt/people/decl/${id}`,
    method: 'post'
  })
}

// 边民备案-审核
export function BorderPeopleAudit(id) {
  return request({
    url: `/bt/people/audit/${id}`,
    method: 'post'
  })
}

// 边民备案-获取单窗校验
export function BorderPeopleSwValidBatch(ids) {
  return request({
    url: `/bt/people/swValidBatch/${ids}`,
    method: 'post'
  })
}

// 边民备案-校验指纹终端机是否备案
export function contrastFaceInfo(data) {
  return request({
    url: `/bt/faceInfo/contrastFaceInfo`,
    method: 'post',
    data
  })
}

// 边民备案-人脸确认
export function getMacAddress(ids) {
  return request({
    url: `/mac/address/getMacAddress`,
    method: 'get'
  })
}

// 边民备案-指纹确认
export function getFingerprintByIdCard(params) {
  return request({
    url: `/bt/people/fingerprintByIdCard`,
    headers: {
      isToken: false
    },
    method: 'get',
    params
  })
}

// 边民备案-上传人脸照片
export function uploadBorderPhoto(params) {
  return request({
    url: `/common/upload`,
    method: 'post',
    data: params
  })
}

// 边民备案-修改指纹
export function uploadFingerprint(params) {
  return request({
    url: `/bt/people/inputBorderFingerprint`,
    method: 'post',
    data: params
  })
}

// 边民备案-修改人脸照片
export function uploadFaceInfo(params) {
  return request({
    url: `/bt/faceInfo/inputBorderFaceInfo`,
    method: 'post',
    data: params
  })
}

// 根据当前登录用户的身份证号查询边民信息
export function getBorderByCardNo(idCardNo) {
  return request({
    url: '/bt/people/getByCardNo/' + idCardNo,
    method: 'get',
  })
}

/***
 * 商铺备案
 */
// 商铺备案-列表
export function findShopPage(params) {
  return request({
    url: '/bt/record/list',
    method: 'get',
    params
  })
}

// 商铺备案-新增
export function saveShop(params) {
  return request({
    url: '/bt/record',
    method: 'post',
    data: params
  })
}

// 商铺备案-修改
export function updateShop(params) {
  return request({
    url: '/bt/record',
    method: 'put',
    data: params
  })
}

// 边民备案-变更申报
export function updateShopDecl(params) {
  return request({
    url: '/bt/record/modifyDecl',
    method: 'post',
    data: params
  })
}

// 商铺备案-删除
export function deleteShop(ids) {
  return request({
    url: `/bt/record/${ids}`,
    method: 'delete',
  })
}

// 商铺备案-导出列表
export function exportShop(params) {
  return request({
    url: '/bt/record/export',
    method: 'get',
    params
  })
}

// 商铺备案-详情
export function shopDetail(id) {
  return request({
    url: `/bt/record/${id}`,
    method: 'get'
  })
}

// 商铺备案-申报
export function shopDecl(id) {
  return request({
    url: `/bt/record/decl/${id}`,
    method: 'post'
  })
}

// 商铺备案-审核
export function shopAudit(id) {
  return request({
    url: `/bt/record/audit/${id}`,
    method: 'post'
  })
}


/***
 * 证书预备案
 */
// 证书预备案-列表
export function findCertPreRecordPage(params) {
  return request({
    url: '/bt/certPreRecord/list',
    method: 'get',
    params
  })
}

// 证书预备案-新增
export function saveCertPreRecord(params) {
  return request({
    url: '/bt/certPreRecord/add',
    method: 'post',
    data: params
  })
}

// 证书预备案-修改
export function updateCertPreRecord(params) {
  return request({
    url: '/bt/certPreRecord/edit',
    method: 'post',
    data: params
  })
}

/**
 * @param {Object} params 证书备案变更
 */
export function modifyCertPreRecord(params) {
  return request({
    url: '/bt/certPreRecord/modify',
    method: 'post',
    data: params
  })
}

// 证书预备案-删除
export function DeleteCertPreRecord(ids) {
  return request({
    url: `/bt/certPreRecord/remove/${ids}`,
    method: 'get',
  })
}

// 证书预备案-导出列表
export function exportCertPreRecord(params) {
  return request({
    url: '/bt/certPreRecord/export',
    method: 'get',
    params
  })
}

// 证书预备案-申报
export function certPreRecordDecl(id) {
  return request({
    url: `/bt/certPreRecord/decl/${id}`,
    method: 'get'
  })
}

// 证书预备案-详情
export function certPreRecordDetail(id) {
  return request({
    url: `/bt/certPreRecord/getInfo/${id}`,
    method: 'get'
  })
}

// 证书预备案-详情
export function getInfoByPutrecNo(putrecNo) {
  return request({
    url: `/bt/certPreRecord/getInfoByPutrecNo/${putrecNo}`,
    method: 'get'
  })
}


/***
 * 互助组备案
 */
// 互助组备案-列表
export function findGroupPage(params) {
  return request({
    url: '/bt/group/list',
    method: 'get',
    params
  })
}

// 互助组备案-新增
export function saveGroup(params) {
  return request({
    url: '/bt/group',
    method: 'post',
    data: params
  })
}

// 互助组备案-修改
export function updateGroup(params) {
  return request({
    url: '/bt/group',
    method: 'put',
    data: params
  })
}


// 互助组备案-删除
export function deleteGroup(ids) {
  return request({
    url: `/bt/group/${ids}`,
    method: 'delete',
  })
}

// 互助组备案-导出列表
export function exportGroup(params) {
  return request({
    url: '/bt/group/export',
    method: 'get',
    params
  })
}

// 互助组备案-详情
export function groupDetail(id) {
  return request({
    url: `/bt/group/${id}`,
    method: 'get'
  })
}

// 互助组备案-申报
export function groupDecl(id) {
  return request({
    url: `/bt/group/decl/${id}`,
    method: 'post'
  })
}

/***
 * 进出口申报
 */
// 进出口申报-列表
export function findImportExportPage(params) {
  return request({
    url: '/bt/ieportDeclBills/list',
    method: 'get',
    params
  })
}

// 进出口申报-新增
export function saveImportExport(params) {
  return request({
    //url: '/bt/btUnifiedDeclaration/ieportBillAdd',
    url: '/bt/ieportDeclBills/add',
    method: 'post',
    data: params
  })
}

// 进出口申报-修改
export function updateImportExport(params) {
  return request({
    url: '/bt/ieportDeclBills/edit',
    method: 'post',
    data: params
  })
}

// 进出口申报-撤销
export function revokedImportExport(params) {
  return request({
    url: '/bt/ieportDeclBills/revoke',
    method: 'post',
    data: params
  })
}// 进出口申报-变更
export function modifyImportExport(params) {
  return request({
    url: '/bt/ieportDeclBills/modify',
    method: 'post',
    data: params
  })
}

// 进出口申报-删除
export function deleteImportExport(ids) {
  return request({
    url: `/bt/ieportDeclBills/remove/${ids}`,
    method: 'delete',
  })
}

// 进出口申报-导出列表
export function exportImportExport(params) {
  return request({
    url: '/bt/ieportDeclBills/export',
    method: 'get',
    params
  })
}

// 进出口申报-详情
export function ImportExportDetail(id) {
  return request({
    url: `/bt/ieportDeclBills/getInfo/${id}`,
    method: 'get'
  })
}

// 进出口申报-申报
export function ImportExportDecl(id) {
  return request({
    url: `/bt/group/decl/${id}`,
    method: 'post'
  })
}

// 进出口申报-申报
export function getConfigByField(params) {
  return request({
    url: `/system/btConfig/getInfoByFiledCode/${params.fieldCode}`,
    method: 'post'
  })
}


// 边民互助组备案-列表
export function getSupportGroupList(params) {
  return request({
    url: '/border/findMutualAidGroupForPage',
    method: 'get',
    params
  })
}

// 边民互助组备案-新增
export function saveSupportGroup(params) {
  return request({
    url: '/border/saveMutualAidGroup',
    method: 'post',
    data: params
  })
}


// 查询进出境申报单列表
export function saveApi(params) {
  return request({
    url: '/border/saveEntryExitForm',
    method: 'post',
    data: params
  })
}


// 边民合作社-列表
export function getCooperativeList(params) {
  return request({
    url: '/border/findCooperativeRecordForPage',
    method: 'get',
    params
  })
}

// 边民合作社-新增
export function saveCooperative(params) {
  return request({
    url: '/border/saveCooperativeRecord',
    method: 'post',
    data: params
  })
}

// 落地加工企业-列表
export function getEnterprisesList(params) {
  return request({
    url: '/border/findContractorRecordForPage',
    method: 'get',
    params
  })
}

// 落地加工企业-新增
export function saveEnterprises(params) {
  return request({
    url: '/border/saveContractorRecord',
    method: 'post',
    data: params
  })
}

// 场所经营人、运输工具负责人-列表
export function getPlaceToolList(params) {
  return request({
    url: '/bt/BtFielderTransporterRecord/list',
    method: 'get',
    params
  })
}

// 场所经营人、运输工具负责人-新增
export function savePlaceTool(params) {
  return request({
    url: '/border/savePlaceToolPerson',
    method: 'post',
    data: params
  })
}

// 边民-不分页列表
export function findBorderPeopleAll(params) {
  return request({
    url: '/bt/people/findList',
    method: 'get',
    params
  })
}

// 商铺-不分页列表
export function findShopAll(params) {
  return request({
    url: '/bt/record/findList',
    method: 'get',
    params
  })
}

// 互助组-不分页列表
export function findGroupAll(params) {
  return request({
    url: '/bt/group/findList',
    method: 'get',
    params
  })
}

// 合作社-不分页列表
export function findCooperativeAll(params) {
  return request({
    url: '/bt/BtCooperativeRecord/findList',
    method: 'get',
    params
  })
}

// 查询证书预备案列表-已备案
export function findCertPreRecordAll(params) {
  return request({
    url: '/bt/certPreRecord/findList',
    method: 'get',
    params
  })
}


// 互市一站式申报-新增
export function saveUnifiedDeclaration(params) {
  return request({
    url: '/bt/btUnifiedDeclaration/add',
    method: 'post',
    data: params
  })
}

// 互市一站式申报-列表
export function getUnifiedDeclarationList(params) {
  return request({
    url: '/bt/btUnifiedDeclaration/list',
    method: 'get',
    params
  })
}

// 互市一站式申报-详情
export function getUnifiedDeclarationDetail(unifiedCode) {
  return request({
    url: '/bt/btUnifiedDeclaration/getInfo/' + unifiedCode,
    method: 'get',
  })
}


// 互市一站式申报-进出境申报
export function declMftManifestHSEntry(id) {
  return request({
    url: '/bt/ieborderDeclBills/decl/' + id,
    method: 'post'
  })
}

// 互市一站式申报-进出口申报
export function declMftManifestHSImport(id) {
  return request({
    url: '/bt/ieportDeclBills/decl/' + id,
    method: 'post'
  })
}

// 一般贸易一站式申报-新增
export function saveGtUnifiedDeclaration(params) {
  return request({
    url: '/bt/gtUnifiedDeclaration/add',
    method: 'post',
    data: params
  })
}

// 空车确报-新增
export function saveEmptyVehicleDeclaration(params) {
  return request({
    url: '/bt/gtUnifiedDeclaration/emptyBdAdd',
    method: 'post',
    data: params
  })
}

// 空车确报-列表
export function getEmptyVehicleDeclarationList(params) {
  return request({
    url: '/bt/mftManifestHead/bdList',
    method: 'get',
    params
  })
}




// 交易商铺绑定信息列表
export function bindShopList(params) {
  return request({
    url: '/bt/bindingShop/list',
    method: 'get',
    params
  })
}

// 绑定商铺
export function bindShopApi(params) {
  return request({
    url: '/bt/bindingShop/bindShop',
    method: 'post',
    data: params
  })
}

//获取预录入用户关区信息
export function preEntryUserAccount() {
  return request({
    url: '/bt/btPreEntryHead/getLoginUserPortInfo',
    method: 'get'
  })
}

//边民批量同步
export function borderPeopleBatchSync(ids) {
  return request({
    url: '/bt/people/syncToApp/' + ids,
    // url: '/bt/people/syncData',
    method: 'post'
  })
}

//商品配置批量同步
export function goodsConfigBatchSync() {
  return request({
    url: '/system/goodsConfig/syncData',
    method: 'get'
  })
}


//商铺批量同步
export function shopInfoBatchSync() {
  return request({
    url: '/bt/record/syncData',
    method: 'get'
  })
}

//商铺批量同步二级市场
export function shopInfoBatchSyncToApp(ids) {
  return request({
    url: '/bt/record/syncToApp/' + ids,
    method: 'post'
  })
}

//进口申报单批量同步
export function ieportBillsBatchSync() {
  return request({
    url: '/bt/ieportDeclBills/syncData',
    method: 'get'
  })
}

//交易结算批量同步
export function settlementBatchSync() {
  return request({
    url: '/bt/importSettlementBills/syncData',
    method: 'get'
  })
}

// 自动分配舱单号、提单号
export function getMftCode() {
  return request({
    url: '/bt/mftDeclAccountInfo/getMftCode',
    method: 'get'
  })
}




